#pragma once
#include "bg_global.h"
#include "q_shared.h"
#include "CVec3.h"

CDECL_FUNCTION(qboolean, CheatsOK, (gentity_t *ent)); //known
CDECL_FUNCTION(const char *, CG_ArgvX, (int num)); //known
CDECL_FUNCTION(void, G_SpawnItemX, (gentity_t *ent, gitem_t *item)); //assumed
CDECL_FUNCTION(qboolean, G_CheckInSolidX, (gentity_t *ent, qboolean)); //known
CDECL_FUNCTION(char *, vtosX, (vec3_t)); //return type assumed
CDECL_FUNCTION(DWORD *, TAG_AddX, ( const char *name, const char *owner, vec3_t origin, vec3_t angles, float radius, int flags )); //assumed, substitute arg type
CDECL_FUNCTION(void, NAV__SpawnedPointX, ( gentity_t *ent, int unknown)); //speculative/class function
CDECL_FUNCTION(void, G_FreeEntityX, ( gentity_t *ent )); //known
CDECL_FUNCTION(gitem_t *, BG_FindItemForWeaponX, ( int )); //known
CDECL_FUNCTION(void, G_Unknown1X, (gitem_t *item, vec3_t unk1, vec3_t unk2, float unk3, float unk4, float unk5)); //no idea.
CDECL_FUNCTION(void, G_SetOriginX, (gentity_t *ent, vec3_t unk)); //no idea --FOUND
CDECL_FUNCTION(void, G_SetAnglesX, (gentity_t *ent, vec3_t unk)); //no idea --FOUND
CDECL_FUNCTION(int, G_ModelIndexX, (char *)); //Known, unknown where the value goes (s.modelindex is unknown)
/*CDECL_FUNCTION(qboolean, MoveTraceX, (const CVec3& Start, const CVec3& Stop, const CVec3& Mins, const CVec3& Maxs,
					int ignoreEnt, qboolean CheckForDoNotEnter, qboolean RetryIfStartInDoNotEnter, 
					qboolean IgnoreAllEnts, int OverrideContents));*/

CDECL_FUNCTION(float, waypoint_testDirectionX, (vec3_t origin, float yaw, float minDist));

CG_ArgvX CG_Argv;
G_SpawnItemX G_SpawnItem;
G_CheckInSolidX G_CheckInSolid;
vtosX vtos;
TAG_AddX TAG_Add;
NAV__SpawnedPointX NAV__SpawnedPoint;
G_FreeEntityX G_FreeEntity;
BG_FindItemForWeaponX BG_FindItemForWeapon;
G_Unknown1X G_Unknown1;
G_SetOriginX G_SetOrigin;
G_SetAnglesX G_SetAngles;
G_ModelIndexX G_ModelIndex;
//MoveTraceX MoveTrace;

waypoint_testDirectionX waypoint_testDirection;

game_import_t *gi;
game_export_t *globals;

// Globals rerouting

void ClientCommand( int clientNum );
void ShutdownGame( void );

BLANK_FUNCTION(void, gamex86ClientCommand, ( int clientCommand ));
BLANK_FUNCTION(void, gamex86ShutdownGame, ( void ));
gamex86ClientCommand ClientCommandX;
gamex86ShutdownGame ShutdownGameX;

// Spawn Functions
CDECL_FUNCTION(void, SpawnFunc, (gentity_t *ent));

SpawnFunc SP_NPC_Spawner;
SpawnFunc SP_waypoint_navgoal;
SpawnFunc SP_waypoint;